<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=9"/>
    <title>Wi-Fi Host Driver (WHD): whd_buffer_funcs Struct Reference</title>
    <link href="tabs.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript" src="dynsections.js"></script>
    <link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
    <link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
    <link href="doxygen.css" rel="stylesheet" type="text/css" />
  </head>
  <body>
    <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
      <div id="titlearea" style="font-family:verdana;">
        <table border='0' cellpadding='0' cellspacing='0' width="98%">
          <tr style="height:20px"><td>&nbsp;</td></tr>
          <tr style="border-collapse: collapse; padding: 0;">
            <td style="width:20px"></td>
            <td style="width:117px"><img src="ifx_logo.png" alt="Infineon Logo" /></td>
            <td style="vertical-align:middle; text-align:center; font: bold 25px/100% Verdana, Arial, Helvetica, sans-serif;">
              Wi-Fi Host Driver (WHD) Public API Reference Guide
            </td>
          </tr>
          <tr><td>&nbsp;</td></tr>
        </table>
    </div>
    <!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('structwhd__buffer__funcs.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-attribs">Data Fields</a>  </div>
  <div class="headertitle">
<div class="title">whd_buffer_funcs Struct Reference<div class="ingroups"><a class="el" href="group__buffif.html">WHD Buffer Interface API</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<div class="textblock"><p>Allows WHD to perform buffer related operations like, allocating, releasing, retrieving the current pointer of and size of a packet buffer. </p>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Data Fields</h2></td></tr>
<tr class="memitem:ab30db243f3933eac39624c7cfa448abc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="whd__types_8h.html#add62f4b5040a2451e23869d2f9e1ae05">whd_result_t</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwhd__buffer__funcs.html#ab30db243f3933eac39624c7cfa448abc">whd_host_buffer_get</a> )(whd_buffer_t *buffer, <a class="el" href="group__buffif.html#ga44a64c51498b204ceef5555209e29452">whd_buffer_dir_t</a> direction, uint16_t size, uint32_t timeout_ms)</td></tr>
<tr class="memdesc:ab30db243f3933eac39624c7cfa448abc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocates a packet buffer.  <a href="#ab30db243f3933eac39624c7cfa448abc">More...</a><br /></td></tr>
<tr class="separator:ab30db243f3933eac39624c7cfa448abc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a25e0a4f8235603094896917b3421baac"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwhd__buffer__funcs.html#a25e0a4f8235603094896917b3421baac">whd_buffer_release</a> )(whd_buffer_t buffer, <a class="el" href="group__buffif.html#ga44a64c51498b204ceef5555209e29452">whd_buffer_dir_t</a> direction)</td></tr>
<tr class="memdesc:a25e0a4f8235603094896917b3421baac"><td class="mdescLeft">&#160;</td><td class="mdescRight">Releases a packet buffer.  <a href="#a25e0a4f8235603094896917b3421baac">More...</a><br /></td></tr>
<tr class="separator:a25e0a4f8235603094896917b3421baac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c2483392b61c9f4619e5fc83ec48601"><td class="memItemLeft" align="right" valign="top">uint8_t *(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwhd__buffer__funcs.html#a5c2483392b61c9f4619e5fc83ec48601">whd_buffer_get_current_piece_data_pointer</a> )(whd_buffer_t buffer)</td></tr>
<tr class="memdesc:a5c2483392b61c9f4619e5fc83ec48601"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves the current pointer of a packet buffer.  <a href="#a5c2483392b61c9f4619e5fc83ec48601">More...</a><br /></td></tr>
<tr class="separator:a5c2483392b61c9f4619e5fc83ec48601"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a720960b687167d7ab440ee432e048f9d"><td class="memItemLeft" align="right" valign="top">uint16_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwhd__buffer__funcs.html#a720960b687167d7ab440ee432e048f9d">whd_buffer_get_current_piece_size</a> )(whd_buffer_t buffer)</td></tr>
<tr class="memdesc:a720960b687167d7ab440ee432e048f9d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves the size of a packet buffer.  <a href="#a720960b687167d7ab440ee432e048f9d">More...</a><br /></td></tr>
<tr class="separator:a720960b687167d7ab440ee432e048f9d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5b22cc6ad30a5430bbe4c3a137d7b3cc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="whd__types_8h.html#add62f4b5040a2451e23869d2f9e1ae05">whd_result_t</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwhd__buffer__funcs.html#a5b22cc6ad30a5430bbe4c3a137d7b3cc">whd_buffer_set_size</a> )(whd_buffer_t buffer, uint16_t size)</td></tr>
<tr class="memdesc:a5b22cc6ad30a5430bbe4c3a137d7b3cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the current size of a WHD packet.  <a href="#a5b22cc6ad30a5430bbe4c3a137d7b3cc">More...</a><br /></td></tr>
<tr class="separator:a5b22cc6ad30a5430bbe4c3a137d7b3cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab4c0aef4cb8722f8b22209592a84594a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="whd__types_8h.html#add62f4b5040a2451e23869d2f9e1ae05">whd_result_t</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwhd__buffer__funcs.html#ab4c0aef4cb8722f8b22209592a84594a">whd_buffer_add_remove_at_front</a> )(whd_buffer_t *buffer, int32_t add_remove_amount)</td></tr>
<tr class="memdesc:ab4c0aef4cb8722f8b22209592a84594a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Moves the current pointer of a packet buffer.  <a href="#ab4c0aef4cb8722f8b22209592a84594a">More...</a><br /></td></tr>
<tr class="separator:ab4c0aef4cb8722f8b22209592a84594a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Field Documentation</h2>
<a id="ab30db243f3933eac39624c7cfa448abc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab30db243f3933eac39624c7cfa448abc">&#9670;&nbsp;</a></span>whd_host_buffer_get</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="whd__types_8h.html#add62f4b5040a2451e23869d2f9e1ae05">whd_result_t</a>(* whd_host_buffer_get) (whd_buffer_t *buffer, <a class="el" href="group__buffif.html#ga44a64c51498b204ceef5555209e29452">whd_buffer_dir_t</a> direction, uint16_t size, uint32_t timeout_ms)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Allocates a packet buffer. </p>
<p>Implemented in the port layer interface which is specific to the buffering scheme in use. Attempts to allocate a packet buffer of the size requested. It can do this by allocating a pre-existing packet from a pool, using a static buffer, or by dynamically allocating memory. The method of allocation does not concern WHD, however it must match the way the network stack expects packet buffers to be allocated. Usually WHD requires packet of size of WHD_LINK_MTU which includes the MTU, other other various header. Refer to <a class="el" href="whd__types_8h.html" title="Defines common data types used with WHD.">whd_types.h</a> to find the size of WHD_LINK_MTU</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buffer</td><td>A pointer which receives the allocated packet buffer handle </td></tr>
    <tr><td class="paramname">direction</td><td>Indicates transmit/receive direction that the packet buffer is used for. This may be needed if tx/rx pools are separate. </td></tr>
    <tr><td class="paramname">size</td><td>The number of bytes to allocate. </td></tr>
    <tr><td class="paramname">timeout_ms</td><td>Maximum period to block for available buffer</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>WHD_SUCCESS or error code </dd></dl>

</div>
</div>
<a id="a25e0a4f8235603094896917b3421baac"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a25e0a4f8235603094896917b3421baac">&#9670;&nbsp;</a></span>whd_buffer_release</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void(* whd_buffer_release) (whd_buffer_t buffer, <a class="el" href="group__buffif.html#ga44a64c51498b204ceef5555209e29452">whd_buffer_dir_t</a> direction)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Releases a packet buffer. </p>
<p>Implemented in the port layer interface, which will be specific to the buffering scheme in use. This function is used by WHD to indicate that it no longer requires a packet buffer. The buffer can then be released back into a pool for reuse, or the dynamically allocated memory can be freed, according to how the packet was allocated. Returns void since WHD cannot do anything about failures</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buffer</td><td>The handle of the packet buffer to be released </td></tr>
    <tr><td class="paramname">direction</td><td>Indicates transmit/receive direction that the packet buffer has been used for. This might be needed if tx/rx pools are separate. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a5c2483392b61c9f4619e5fc83ec48601"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5c2483392b61c9f4619e5fc83ec48601">&#9670;&nbsp;</a></span>whd_buffer_get_current_piece_data_pointer</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t*(* whd_buffer_get_current_piece_data_pointer) (whd_buffer_t buffer)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieves the current pointer of a packet buffer. </p>
<p>Implemented in the port layer interface which is specific to the buffering scheme in use. Since packet buffers usually need to be created with space at the front for additional headers, this function allows WHD to get the current 'front' location pointer.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buffer</td><td>The handle of the packet buffer whose pointer is to be retrieved</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The packet buffer's current pointer. </dd></dl>

</div>
</div>
<a id="a720960b687167d7ab440ee432e048f9d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a720960b687167d7ab440ee432e048f9d">&#9670;&nbsp;</a></span>whd_buffer_get_current_piece_size</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint16_t(* whd_buffer_get_current_piece_size) (whd_buffer_t buffer)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieves the size of a packet buffer. </p>
<p>Implemented in the port layer interface which is specific to the buffering scheme in use. Since packet buffers usually need to be created with space at the front for additional headers, the memory block use to contain a packet buffer will often be larger than the current size of the packet buffer data. This function allows WHD to retrieve the current size of a packet buffer's data.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buffer</td><td>The handle of the packet buffer whose size is to be retrieved</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The size of the packet buffer. </dd></dl>

</div>
</div>
<a id="a5b22cc6ad30a5430bbe4c3a137d7b3cc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5b22cc6ad30a5430bbe4c3a137d7b3cc">&#9670;&nbsp;</a></span>whd_buffer_set_size</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="whd__types_8h.html#add62f4b5040a2451e23869d2f9e1ae05">whd_result_t</a>(* whd_buffer_set_size) (whd_buffer_t buffer, uint16_t size)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the current size of a WHD packet. </p>
<p>Implemented in the port layer interface which is specific to the buffering scheme in use. This function sets the current length of a WHD packet buffer</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buffer</td><td>The packet to be modified </td></tr>
    <tr><td class="paramname">size</td><td>The new size of the packet buffer</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>WHD_SUCCESS or error code </dd></dl>

</div>
</div>
<a id="ab4c0aef4cb8722f8b22209592a84594a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab4c0aef4cb8722f8b22209592a84594a">&#9670;&nbsp;</a></span>whd_buffer_add_remove_at_front</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="whd__types_8h.html#add62f4b5040a2451e23869d2f9e1ae05">whd_result_t</a>(* whd_buffer_add_remove_at_front) (whd_buffer_t *buffer, int32_t add_remove_amount)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Moves the current pointer of a packet buffer. </p>
<p>Implemented in the port layer interface which is specific to the buffering scheme in use.</p>
<p>Since packet buffers usually need to be created with space at the front for additional headers, this function allows WHD to move the current 'front' location pointer so that it has space to add headers to transmit packets, and so that the network stack does not see the internal WHD headers on received packets.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buffer</td><td>A pointer to the handle of the current packet buffer for which the current pointer will be moved. On return this may contain a pointer to a newly allocated packet buffer which has been daisy chained to the front of the given packet buffer. This would be the case if the given packet buffer didn't have enough space at the front. </td></tr>
    <tr><td class="paramname">add_remove_amount</td><td>This is the number of bytes to move the current pointer of the packet buffer - a negative value increases the space for headers at the front of the packet, a positive value decreases the space.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>WHD_SUCCESS or error code </dd></dl>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="whd__network__types_8h.html">whd_network_types.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
    <!-- start footer part -->
    <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
      <ul>
        <li class="navelem"><a class="el" href="structwhd__buffer__funcs.html">whd_buffer_funcs</a></li>
        <li class="footer">Copyright Infineon Technologies.</li>
      </ul>
    </div>
  </body>
</html>
